/*
* 数字类型输入
* */
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:frametrim/utility/sq_color.dart';

class TextfieldNum extends StatelessWidget {
  TextEditingController _phoneController;
  late String hintText;
  late int maxLength;

  TextfieldNum(this.hintText, this.maxLength,this._phoneController);

  @override
  Widget build(BuildContext context) {
    return TextField(
      maxLength: maxLength,
      //键盘样式
      keyboardType: TextInputType.number,
      controller: _phoneController,
      decoration: InputDecoration(
        // 去除输入框底部的字符计数,例如11/20
        counterText: '',

        /*去掉下划线*/
        // border: InputBorder.none,

        //contentPadding+border 设置TextField垂直居中
        contentPadding: EdgeInsets.symmetric(vertical: 0),
        border: OutlineInputBorder(borderSide: BorderSide.none),

        hintText: hintText,
        hintStyle: TextStyle(fontSize: 15, color: SQColor.color_aeaeae),
        labelStyle: TextStyle(fontSize: 15, color: SQColor.black),
      ),
    );
  }
}
